﻿using System;
using Oscilloscope.Channel;
using Oscilloscope.ChannelBuffer;

namespace Oscilloscope.Curve
{
	// Token: 0x02000003 RID: 3
	internal class CurveGeneratorFactory
	{
		// Token: 0x0600000E RID: 14 RVA: 0x00003512 File Offset: 0x00001712
		private CurveGeneratorFactory()
		{
		}

		// Token: 0x0600000F RID: 15 RVA: 0x0000351C File Offset: 0x0000171C
		public static ICurveGenerator CurveGenerator(IChannel channel)
		{
			if (channel == null)
			{
				throw new ArgumentNullException("channel");
			}
			if (channel.GetChannelBuffer().GetSignalType() == SignalType.DigitalMultiple)
			{
				return new MultipleDigitalCurveGenerator(channel);
			}
			if (channel.GetChannelBuffer().GetSignalType() == SignalType.DigitalSingle)
			{
				return new SingleDigitalCurveGenerator(channel);
			}
			if (channel.GetChannelBuffer().GetSignalType() == SignalType.AnalogSigned)
			{
				return new AnalogCurveGenerator(channel);
			}
			if (channel.GetChannelBuffer().GetSignalType() == SignalType.AnalogUnsigned)
			{
				return new AnalogCurveGenerator(channel);
			}
			throw new NotImplementedException();
		}
	}
}
